<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="common.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link href="CSS/style1.css" rel="stylesheet">
    </head>
<body>  
  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
<table width="777" height="768"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td valign="top">
        <jsp:include page="banner.jsp"/>
	<table width="100%" height="330"  border="0" cellpadding="0" cellspacing="0">
        <tr>      
     
          <td width="73%" valign="top"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td height="53" colspan="3" background="Images/index_110.gif">
		<jsp:include page="search.jsp"/></td>
            </tr>
            <%              
           //    request.setCharacterEncoding("utf-8");
                        String key="";
                           String bookKeyid=convert(request.getParameter("selectid"));
                          if(bookKeyid.equals("书号")) key="bookid";
                          else
                          if(bookKeyid.equals("作者")) key="name";
                          else
                          if(bookKeyid.equals("出版社")) key="pubilsher";
                           String sql=convert(request.getParameter("bookId"));
            %>
            <tr>
              <td width="97%" height="220" valign="top">
			   <table width="100%" height="126"  border="0" cellpadding="0" cellspacing="0">

			    <tr>
                  <td valign="top"><table width="100%" height="55"  border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td height="40" class="tableBorder_B"> &nbsp;&nbsp;<font size="+2">您输入的查询关键字为：</font><font size="+2" color="#FF0000">[<%=bookKeyid%>]</font></td>
                    </tr>
                    <tr>
                      <td width="86%" height="100" valign="top">
						<table width="96%" height="34"  border="0" align="center" cellpadding="0" cellspacing="0" class="tableBorder_B">
                   <tr bgcolor="#CCCCCC">
                            <td width="6%" height="33" align="center">&nbsp;</td>
                            <td width="48%" style="padding:5px;">&nbsp;&nbsp;&nbsp;&nbsp;<font size="+2"><b>书名</b></font></td>
                            <td width="35%" style="padding:5px;">&nbsp;&nbsp;<font size="+2"><b>出版社</b></font></td>
                            <td width="11%" style="padding:5px;">&nbsp;&nbsp;<font size="+2"><b>购买</b></font></td>
                          </tr>
                                    </table>
 
           
<%
                 
                java.util.Collection collect = bookDB.getBookSearch(key, sql);
                java.util.Iterator i = collect.iterator();
                BookDetails bt = null;             
                while (i.hasNext()) {
                bt = (BookDetails) i.next();
 %> 

                        <table width="96%" height="21"  border="0" align="center" cellpadding="0" cellspacing="0" class="tableBorder_B">
                          <tr>
                            <td width="6%" align="center"><img src="Images/greendot.gif" width="11" height="13"></td>
                            <td width="48%" style="padding:5px;"><a href="bookdetails.jsp?bookId=<%=bt.getBookid()%>"><%=bt.getTitle()%></a></td>
                            <td width="35%" style="padding:5px;"><%=bt.getPubilsher()%></td>
                            <td width="11%" style="padding:5px;">
						                    <%if(session.getAttribute("UserName")!=null){%>
							<input name="Submit5" type="submit" class="btn_grey" value="加入购物车" onClick="window.location.href='catalog.jsp?Add=<%=bt.getBookid()%>'">
							<%}else{ 
							out.println("请先登录");
							}%>
							</td>
                          </tr>
                        </table>
                       <%}%>
			                      </td>
                    </tr>
                  </table>
		  </td>
			     </tr>
              </table>				  
					  </td>
              <td width="3%" valign="top">&nbsp;</td>
            </tr>
          </table></td>
        </tr>
      </table>
      <jsp:include page="copyright.jsp"/>
    </td>
  </tr>
</table>
</td>
  </tr>
</table>
    </body>
</html>
